﻿Imports MySql.Data.MySqlClient
Imports MySql.Data
Public Class MySQLConexao

    Public Function Connection() As MySqlConnection
        Dim contemp As New MySql.Data.MySqlClient.MySqlConnection("server=" & My.Settings.MySQLIpHost & ";User Id=" & My.Settings.MySQLUsuario & ";password=" & My.Settings.MySQLSenha & ";Persist Security Info=True;database=" & My.Settings.MySQLDataBase & ";port=" & My.Settings.MySQLPorta & ";")
        Try
            If contemp.State = ConnectionState.Open Then contemp.Close()
            contemp.Open()
        Catch ex As MySqlException
            MySQLErro.ChecaErro(ex)
            Return contemp
        End Try

        Return contemp
    End Function

End Class
